
<meta charset="utf-8">
<script>
    var name = "五年间，，，，，，，。";
    var acount = 0;
    var weizhi = name.indexOf("，");
    while(weizhi!=-1){
        weizhi = name.indexOf("，",weizhi+1);
        acount++;
    }
    alert(acount);
</script>